package cn.jzq.demo.mapper;

import cn.jzq.demo.entity.GeneralStudent;
import com.baomidou.dynamic.datasource.DS;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jzq
 * @since 2018-05-22
 */
@Mapper
public interface GeneralStudentMapper extends BaseMapper<GeneralStudent> {
    @DS
//    @Cacheable(value = "student", key = "#p0")
//    @Cacheable(value = "student", key = "'student_'.concat(#p0)")
    GeneralStudent getStudentByStuNo(String stuNo);

    @DS("one")
    @Cacheable(value = "students")
    List<GeneralStudent> listStudent();

    void insertStudent(GeneralStudent student);

    void saveBatch(List<GeneralStudent> list);
}
